package source.view.viewobjects;

import java.awt.Graphics2D;

import source.model.ObjectID;

/**
 * Basic object that the View will be displaying.
 * @author Steve
 *
 */
public abstract class ViewObject {
	private ObjectID oid;
	
	/**
	 * Paints the object onto the given graphics context.
	 * @param g the graphics context to be painted on
	 */
	public abstract void paint(Graphics2D g);
	
	public void setObjectID(ObjectID oid){
		this.oid = oid;
	}
	
	public ObjectID objectID(){
		return oid;
	}
	
	public boolean equals(ViewObject vobj){
		if(oid != null){
			return oid.getID().equals(vobj.objectID().getID());
		}
		else{
			return false;
		}
	}
}
